package com.gzhryc.shared_device.cdb.code.dao.enums;

import com.gzhryc.common.config.I18nTools;

public class PortableBatteryEnum {

	public enum State{

		Stock(1,"库存"),Charging(2,"充电中"),Lease(3,"租借中");
		
		private Integer index;
		private String note;
		
		State(Integer index,String note){
			this.index = index;
			this.note = note;
		}

		public Integer index() {
			return index;
		}

		public String note() {
			I18nTools.I18n i18n = I18nTools.getCurrentI18n();
			if(i18n != null) {
				return i18n.get(this.name(),note);
			}
			return note;
		}
		
		public static String note(Integer index){
			State[] temp = State.values();
			for(int i=0;i<temp.length;i++){
				State item = temp[i];
				if(item.index.equals(index)){
					return item.note();
				}
			}
			return null;
		}
	}
}
